package com.code.day09;

public class Person {
    String name = "张三";
    public Person(){
        //调用当前对象的有参构造
        this(1);
        System.out.println("我是无参构造");
    }

    public Person(int i){
        //调用当前对象的无参构造
//        this();
        System.out.println("我是有参构造");
    }

    public void eat(String name){
        System.out.println(name);//小明
        System.out.println(this.name);
        System.out.println("我是成员方法eat");
        //this.drink();
    }

    public void drink(){
        System.out.println("喝水");
    }

}